LinearLayout.addView (View View2Add) 方法可用于 将控件动态地添加到线性布局器中。
http://www.360doc.com/content/10/1108/15/3234041_67645225.shtml
亮点:
final LinearLayout layout2=new LinearLayout(this);
06. layout2.setOrientation(LinearLayout.VERTICAL);
07. Button btn1=new Button(this);
08. setContentView(layout2);
09. Button btn2=new Button(this);
10. btn1.setText("Button1");
11. btn2.setText("Button2");
12. layout2.addView(btn1);
遍身罗绮者,不是养蚕人
HxLauncher: Launch Android applications by voice commands